package com.example.i.spy;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class MainMenuActivity extends Activity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		setContentView(R.layout.activity_main_menu);
		
		// functionality for the how to play button
		Button helpButton = (Button) findViewById(R.id.button_how_to_play);
		helpButton.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) 
			{
				// bring up the HelpScreen activity.
				Intent helpIntent = new Intent (MainMenuActivity.this, HelpScreen.class);
				startActivity(helpIntent);
			}
		});
		
		// functionality for the "start a new game" button
		Button newGameButton = (Button) findViewById(R.id.button_new_game);
		newGameButton.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) 
			{
				// start a new game
				Intent newGameIntent = new Intent(MainMenuActivity.this, PlayerNameScreen.class);
				startActivity(newGameIntent);
				
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main_menu, menu);
		return true;
	}
}
